<%@page import="sdfi.lee.DAO.EmailDAO"%>
<%@page import="sdfi.lee.Entity.Email"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="<c:url value='/css/index.css'/>" />
<link rel="stylesheet" href="<c:url value='/css/level.css'/>" />
<script type="text/javascript" src="<c:url value='/js/jquery-1.6.js'/>"></script>
<script type="text/javascript" src="<c:url value='/js/index.js'/>"></script>
<script type="text/javascript">
	$(function(){
		$(":button").click(function(){
			
			var bt=$(this);
			var option={
					url:"../SendServlet",
					data:{email:bt.attr("email"),content:$("#content").val(),id:$("#mail").val()},
					dataType:"text",
					type:"post",
					success:function(data,status){
						
						if(data=="true")
							{
								$("#content").val("发送成功！");
								window.parent.reload();
							}
							else{
							$("#content").val("发送失败，稍后再试！");
							}
					},
					error:function(xhr,status){
						alert("服务器出错！稍后继续！");
					}
			};
			$.ajax(option);
		});
	});
</script>
<title>Insert title here</title>
<style type="text/css">
	<!-- 
	
		body
		{
				font-family:"华文中宋";
				width:400px;
				margin:0px;
				padding:0px;
		}
	-->
</style>
</head>
<body>

	<%
		String isread=request.getParameter("isread");
		Email email=new EmailDAO().getEmailById(Integer.valueOf(request.getParameter("id")),Boolean.valueOf(isread));
	request.setAttribute("email",email);
	%>
		<center>
	<div style="border:1px solid #CCC;padding:0px 10px;maring-top:10px;">
    	<div style="text-align:left">
        	主任，你好：
        </div>
		<p style="line-height:1.1em;font-size:18px;padding:10px;text-align:left;border-bottom:1px dotted #999999">
		&nbsp;&nbsp;${requestScope.email.content} </p>
		<div style="text-align:right">${requestScope.email.replayName}</div>
      	 <div style="text-align:right">${requestScope.email.relayTo}</div>
      	 <div style="border:1px solid #CCC;text-align:left;">
         	<table width="374">
            	<tr><td width="294" height="23"><textarea name="content" cols="33" id="content" style="border:none;"></textarea>
                </td><td width="68" valign="top">
                <input id="mail" type="hidden" value="${param.id}">
      	 <input  type="button" email="${requestScope.email.relayTo}" value="快速回复" >
         	</td></tr>
         </table>
   	  </div>
	</div>
    </center>
</body>
</html>